<extend name="layout/main" />

<block name="HEADER">

</block>

<block name="CONTENT">
	<control:grid id="grid" />
</block>

<block name="FOOTER">
	<script type="text/javascript">
		var page = (function(ns){
            
            //页面初始化
            ns.init=function(){

            }
		    
		    //新增
		    ns.add=function(){
		    	var filter = {
		            url:$.getModule('edit'),
		            oid:"",
		            mode:1
		        }
		        $.openIframe(filter, "新增",['600px', '500px']);
		    }
		    
		    //编辑
		    ns.edit=function(mode){
		    	var selectedRow = grid.getSelectedRows()[0];
		        var filter = {
		            url: $.getModule('edit'),
		            oid: selectedRow.id ,
		            mode: 2
		        }
		        $.openIframe(filter, "编辑",['600px', '500px']);
		    }  
		    
		    return ns;
		}({}));
		
		
		$(function(){ page.init();  });

	</script>
</block>